<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<style lang="scss">

</style>
<script>
  import {mapState, mapGetters, mapMutations} from 'vuex'

  export default {
    name: "my-index",
    data() {
      return {}
    },
    computed: {
      ...mapState([]),
      ...mapGetters([]),
    },
    methods: {
      ...mapMutations(['setUser']),
      userDetails() {
        this.$api.post('/user/details', {username: 'www'})
          .then( res => this.setUser(res.data))
          .catch( res => console.log(res))
      }
    },
    created() {
      this.userDetails();
    },
    mounted() {

    }
  }
</script>
